//
//  UserLandView.m
//  UI-豆瓣项目APP
//
//  Created by dllo on 15/10/31.
//  Copyright © 2015年 孙鹏. All rights reserved.
//

#import "UserLandView.h"

@implementation UserLandView


- (instancetype)initWithFrame:(CGRect)frame
{
    
    self = [super initWithFrame:frame];
    if (self) {
        
        
        [self creatSubviews];
        
    }
    
    
    return self;
    
}


- (void)creatSubviews
{
    
    self.userName = [[UILabel alloc]initWithFrame:CGRectMake(30, 114, 60, 40)];
    self.userName.text = @"用户名:";
    [self addSubview:self.userName];
    
    self.userName1 = [[UITextField alloc]initWithFrame:CGRectMake(120, 114, 220, 40)];
    self.userName1.borderStyle = UITextBorderStyleRoundedRect;
    self.userName1.placeholder = @"请输入用户名";
    [self addSubview:self.userName1];
    
    self.code = [[UILabel alloc]initWithFrame:CGRectMake(30, 174, 60, 40)];
    self.code.text = @"密码:";
    [self addSubview:self.code];
    
    self.code1 = [[UITextField alloc]initWithFrame:CGRectMake(120, 174, 220, 40)];
    self.code1.borderStyle = UITextBorderStyleRoundedRect;
    self.code1.placeholder = @"请输入密码";
    [self addSubview:self.code1];
    
    
    
    self.land = [UIButton buttonWithType:UIButtonTypeCustom];
    self.land.frame = CGRectMake(25, 244, 150, 50);
    self.land.backgroundColor = [UIColor greenColor];
    [self.land setTitle:@"登陆" forState:UIControlStateNormal];
    self.land.layer.cornerRadius = 8.0;
    [self addSubview:self.land];
    [self.land addTarget:self action:@selector(landAction:) forControlEvents:UIControlEventTouchUpInside];
    
    
    self.login = [UIButton buttonWithType:UIButtonTypeCustom];
    self.login.backgroundColor = [UIColor orangeColor];
    self.login.frame = CGRectMake(200, 244, 150, 50);
    [self.login setTitle:@"注册" forState:UIControlStateNormal];
    self.login.layer.cornerRadius = 8.0;
    [self addSubview:self.login];
    [self.login addTarget:self action:@selector(loginAction:) forControlEvents:UIControlEventTouchUpInside];
    
    
}

- (void)loginAction:(UIButton *)btn
{
    
    [self.delegete presentToLoginView];
    
    
    
    
}

- (void)landAction:(UIButton *)btn

{

        
    [self.delegete presentToLandView];
    
    
   
    
    
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
    
    [self.userName1 resignFirstResponder];
    [self.code1 resignFirstResponder];
   
    
    
}



/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
